﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DMHelper.Models
{
    public class baseBABContainer
    {
        private List<NumericalField> _BABS = new List<NumericalField>();
        public virtual List<NumericalField> BABS { 
            get
            {
                List<NumericalField> retour = new List<NumericalField>();
                foreach (NumericalField n in _BABS)
                {
                    retour.Add(new NumericalField(n.Value + modifiers.Value));
                }
                return retour;
            }
           set
           {_BABS = value;
           }

            }
        public AdditionNumericalField modifiers = new AdditionNumericalField();
        public override string ToString()
        {
            String retour = "";
            for (int i = 0; i< (BABS.Count - 1);i++)
            {
                retour += (BABS[i].Value + modifiers.Value) + " // ";
                
            }

            retour += BABS[BABS.Count - 1];
            return retour;
        }
    }

    public class refBABContainer:baseBABContainer
    {
        private baseBABContainer refe;
        public refBABContainer(baseBABContainer b)
        {
            refe = b;
        }

        public override List<NumericalField> BABS
        {
            get
            {
                return refe.BABS;
            }
            set
            {
               
            }
        }
    }
}